# class Teacher:
#     school = "北大"
#
# t = Teacher()
# print(t.school)
# t.school = "清华"
# print(t.school)
# del Teacher.school
# print(t.school)
# print(Teacher.school)


class Teacher:
    school = "图灵学院"
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def course(self):
        print(f"{self.name} 在 {self.school} 上课")

    @classmethod
    def change_school(cls, new_name):
        cls.school = new_name

    @staticmethod
    def info():
        print("这是教师类")


t1 = Teacher("龙仔", 18)
t2 = Teacher("西施", 18)

t1.course()

Teacher.change_school("清华")
t2.course()

t1.hobby = "篮球"
print(t1.__dict__)

del t1.hobby

print(Teacher.__dict__)




class Student:
    school = "阳光中学"
    def __init__(self, name, grade):
        self.name = name
        self.grade = grade

    def study(self):
        print(f"{self.name} 在 {self.school} 的 {self.grade} 年级学习")

    @classmethod
    def update_school(cls, new_school):
        cls.school = new_school

    @staticmethod
    def class_info():
        print("这是学生类")

s1 = Student("小明", "初一")
s2 = Student("小红", "初二")

s1.study()

Student.update_school("星光中学")
s2.study()

s1.hobby = "足球"
print(s1.__dict__)

del s1.hobby
print(s1.__dict__)

print(Student.__dict__.keys()) 